<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: eosio::singleton&lt; Code, SingletonName, T &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceeosio.html">eosio</a></li><li class="navelem"><a class="el" href="classeosio_1_1singleton.html">singleton</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classeosio_1_1singleton-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">eosio::singleton&lt; Code, SingletonName, T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="singleton_8hpp_source.html">singleton.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a0c3a5437e9b68a71009537a53a9bfbc5"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeosio_1_1singleton.html#a0c3a5437e9b68a71009537a53a9bfbc5">exists</a> (<a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a> scope=Code)</td></tr>
<tr class="separator:a0c3a5437e9b68a71009537a53a9bfbc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4e16f663b7232ef1ba4f17c29639943"><td class="memItemLeft" align="right" valign="top">static T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeosio_1_1singleton.html#ad4e16f663b7232ef1ba4f17c29639943">get</a> (<a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a> scope=Code)</td></tr>
<tr class="separator:ad4e16f663b7232ef1ba4f17c29639943"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8837aa55f7093b6dc6c3caf991d74ca"><td class="memItemLeft" align="right" valign="top">static T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeosio_1_1singleton.html#ac8837aa55f7093b6dc6c3caf991d74ca">get_or_create</a> (<a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a> scope=Code, const T &amp;def=T())</td></tr>
<tr class="separator:ac8837aa55f7093b6dc6c3caf991d74ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a897f32b63fe7330d130d3702cae66cc8"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeosio_1_1singleton.html#a897f32b63fe7330d130d3702cae66cc8">set</a> (const T &amp;value=T(), <a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a> scope=Code)</td></tr>
<tr class="separator:a897f32b63fe7330d130d3702cae66cc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;account_name Code, uint64_t SingletonName, typename T&gt;<br />
class eosio::singleton&lt; Code, SingletonName, T &gt;</h3>

<p>This wrapper uses a single table to store named objects various types.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Code</td><td>- the name of the code which has write permission </td></tr>
    <tr><td class="paramname">SingletonName</td><td>- the name of this singlton variable </td></tr>
    <tr><td class="paramname">T</td><td>- the type of the singleton </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a0c3a5437e9b68a71009537a53a9bfbc5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c3a5437e9b68a71009537a53a9bfbc5">&#9670;&nbsp;</a></span>exists()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;account_name Code, uint64_t SingletonName, typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool <a class="el" href="classeosio_1_1singleton.html">eosio::singleton</a>&lt; Code, SingletonName, T &gt;::exists </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a>&#160;</td>
          <td class="paramname"><em>scope</em> = <code>Code</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ad4e16f663b7232ef1ba4f17c29639943"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4e16f663b7232ef1ba4f17c29639943">&#9670;&nbsp;</a></span>get()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;account_name Code, uint64_t SingletonName, typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static T <a class="el" href="classeosio_1_1singleton.html">eosio::singleton</a>&lt; Code, SingletonName, T &gt;::get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a>&#160;</td>
          <td class="paramname"><em>scope</em> = <code>Code</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ac8837aa55f7093b6dc6c3caf991d74ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8837aa55f7093b6dc6c3caf991d74ca">&#9670;&nbsp;</a></span>get_or_create()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;account_name Code, uint64_t SingletonName, typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static T <a class="el" href="classeosio_1_1singleton.html">eosio::singleton</a>&lt; Code, SingletonName, T &gt;::get_or_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a>&#160;</td>
          <td class="paramname"><em>scope</em> = <code>Code</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>def</em> = <code>T()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a897f32b63fe7330d130d3702cae66cc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a897f32b63fe7330d130d3702cae66cc8">&#9670;&nbsp;</a></span>set()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;account_name Code, uint64_t SingletonName, typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classeosio_1_1singleton.html">eosio::singleton</a>&lt; Code, SingletonName, T &gt;::set </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>value</em> = <code>T()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#ga38500bd43c27c05b7f8a566cefe94656">scope_name</a>&#160;</td>
          <td class="paramname"><em>scope</em> = <code>Code</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>contracts/eoslib/<a class="el" href="singleton_8hpp_source.html">singleton.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
